<%@LANGUAGE="VBSCRIPT"%>
 

<!--#include file="functions.asp" -->
<%

'set cn=Server.CreateObject("ADODB.Connection")
'cn.Open "MP2ENTTEST2", "MP2", "MP2"
dim sql

if (request.querystring("seqnum") <> "0") then
  	sql = "SELECT * FROM EXIAUTHORITY WHERE SEQNUM=" & request.querystring("seqnum")
	set RS=cn.execute(sql)
	
	Do While Not rs.EOF
	  AUTHDESCR = rs("AUTHDESCR")
	  LEVELDESC = rs("LEVELDESC")
	  GROUPDESC = rs("GROUPDESC")
	  MANAGERNAME = rs("MANAGERNAME")
	  EMPCODE = rs("EMPCODE")
	  LOGINNAME = rs("LOGINNAME")
	  INITIAL   = rs("INITIALS")
	  DEPARTMENT = rs("DEPARTMENT")
	  DOANAME = rs("DOANAME")
	  ISDOA = rs("ISDOA")	
	  
	rs.MoveNext
	Loop 
	set rs=nothing

else
      AUTHDESCR = ""
	  LEVELDESC = ""
	  GROUPDESC = ""
	  MANAGERNAME = ""
	  EMPCODE= ""
	  LOGINNAME = ""
	  INITIAL   = ""
	  DEPARTMENT= ""
	  DOANAME = ""
	  ISDOA = "N"
end if
'cn.close
%>
<%
set DEPT = Server.CreateObject("ADODB.Recordset")
DEPT.ActiveConnection = cn
DEPT.Source = "SELECT DEPARTMENT, DESCRIPTION  FROM dbo.DEPT"
'DEPT.CursorType = 0
'DEPT.CursorLocation = 2
'DEPT.LockType = 3
DEPT.Open()
DEPT_numRows = 0
%>
<html>
<head>
<SCRIPT Language="JavaScript">
function openpopup(Url){
winpops=window.open(Url,"","width=600,height=480,Top=25,Left=25,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,menubar=no,resizable=no,")
}
</SCRIPT>
<title>Authorities</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="CAR_style.css" type="text/css">
</head>
<body bgcolor="#93bee2" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="5%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td width="5%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td width="5%">&nbsp;</td>
    <td bgcolor="#FFFFFF" width="2%"><img src="images/curv_data.gif" width="21" height="21"></td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr> 
    <td width="5%">&nbsp;</td>
    <td bgcolor="#FFFFFF" width="2%">&nbsp;</td>
    <td bgcolor="#FFFFFF"> 
      <form name="form1" method="post" action="Authority_process.asp">
        <table width="100%" border="0" cellspacing="2" cellpadding="3">
          <tr> 
            <td width="20%">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="hidden" name="seqnum" value="<%= request.querystring("seqnum") %>">
            </td>
          </tr>
          <tr> 
            <td width="20%" bgcolor="#dedede"> 
              <div align="right"><b>Main Authority:&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="text" name="Authority" class="InputBox" size="40" value="<%= AUTHDESCR %>">
            </td>
          </tr>
          <tr> 
            <td width="20%" bgcolor="#dedede" height="38"> 
              <div align="right"><b>Name:&nbsp;</b></div>
            </td>
            <td width="2%" height="38">&nbsp;</td>
            <td height="38"> 
              <input type="text" name="Name" class="InputBox" size="30" value="<%= MANAGERNAME %>">
              <input type="hidden" name="empCode" value="<%= EMPCODE %>">
              <input type="button" name="Submit3" value=" Select From List " class="sbttn" onClick="openpopup('EmpList.asp?Dept=&fName=form1.empCode&fName2=form1.Name&fName3=form1.Dept')">
            </td>
          </tr>
          <tr> 
            <td width="20%" bgcolor="#dedede"> 
              <div align="right"><b>Initial:&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="text" name="Initial" class="InputBox" size="6" value="<%= INITIAL %>">
            </td>
          </tr>
          <tr> 
            <td width="20%" bgcolor="#dedede"> 
              <div align="right"><b>Email:&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="text" name="reqloginname" size="20" class="InputBox" value="<%= LOGINNAME %>">
              @Premier-Oil.com </td>
          </tr>
          <tr>
            <td width="20%" bgcolor="#dedede"> 
              <div align="right"><b>DOA To:&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="text" name="DOAName" class="InputBox" size="30" value="<%= DOANAME %>">
              <input type="hidden" name="DOA">
              <input type="button" name="Submit32" value=" Select From List " class="sbttn" onClick="openpopup('EmpList.asp?Dept=&fName=form1.DOA&fName2=form1.DOAName&fName3=form1.Dept')">
              &nbsp;&nbsp;&nbsp;
              <input type="checkbox" name="Delegate" value="Y" <% if (ISDOA="Y") then response.write "checked" %>>
              <b>Delegate </b></td>
          </tr>
          <tr> 
            <td width="20%" bgcolor="#dedede"> 
              <div align="right"><b>Department:&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <select name="Dept" class="drpdwn">
                <option <% if (DEPARTMENT="") then response.write "selected" %>> 
                </option>
                <%
While (NOT DEPT.EOF)
%>
                <option value="<%=(DEPT.Fields.Item("DEPARTMENT").Value)%>" <% if (DEPT.Fields.Item("DEPARTMENT").Value=DEPARTMENT) then response.write "selected"  %>><%=(DEPT.Fields.Item("DESCRIPTION").Value)%></option>
                <%
  DEPT.MoveNext()
Wend
If (DEPT.CursorType > 0) Then
  DEPT.MoveFirst
Else
  DEPT.Requery
End If
%>
              </select>
            </td>
          </tr>
          <tr> 
            <td width="20%" bgcolor="#dedede"> 
              <div align="right"><b>Group:&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <select name="Group" class="drpdwn">
                <option value="1" <% if (GROUPDESC = "1" ) then response.write "selected" %>>Group 
                1</option>
                <option value="2" <% if (GROUPDESC = "2" ) then response.write "selected" %>>Group 
                2</option>
                <option value="3" <% if (GROUPDESC = "3" ) then response.write "selected" %>>Group 
                3</option>
                <option value="4" <% if (GROUPDESC = "4" ) then response.write "selected" %>>Group 
                4</option>
                <option value="5" <% if (GROUPDESC = "5" ) then response.write "selected" %>>Group 
                5</option>
                <option value="6" <% if (GROUPDESC = "6" ) then response.write "selected" %>>Group 
                6</option>
                <option value="7" <% if (GROUPDESC = "7" ) then response.write "selected" %>>Group 
                7</option>
                <option value="8" <% if (GROUPDESC = "8" ) then response.write "selected" %>>Group 
                8</option>                
              </select>
            </td>
          </tr>
          <tr> 
            <td width="20%" bgcolor="#dedede"> 
              <div align="right"><b>Manager Level:&nbsp;</b></div>
            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <select name="Level" class="drpdwn" size="1">
                <option <% if (LEVELDESC="") then response.write "selected" %>> 
                </option>
                <option value="Executive Directors" <% if (LEVELDESC="Executive Directors") then response.write "selected" %>>Executive 
                Directors</option>
                <option value="Business Unit Manager" <% if (LEVELDESC="Business Unit Manager") then response.write "selected" %>>Business 
                Unit Manager</option>
                <option value="Manager" <% if (LEVELDESC="Manager") then response.write "selected" %>>Manager</option>
                <option value="Managers/Senior Staff" <% if (LEVELDESC="Managers/Senior Staff") then response.write "selected" %>>Managers/Senior 
                Staff</option>
              </select>
            </td>
          </tr>
          <tr> 
            <td width="20%">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td width="20%">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="submit" name="Submit" value="  Save  " class="sbttn">
              <input type="button" name="Submit2" value="  Close  " class="sbttn" onClick="window.close()">
            </td>
          </tr>
        </table>
      </form>
    </td>
  </tr>
</table>
</body>
</html>
<%
DEPT.Close()
%>
